package com.mine.crawler.config;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

import org.apache.log4j.Logger;

public class ConfigLoader
{
	private static Logger log = Logger.getLogger(ConfigLoader.class); 
	static String configFileName; 
	static File configFile;
	static FileInputStream fileInpStr;
	
	public static Properties LoadFromFile(String fileName)
	{
		configFile = new File(fileName);
		Properties defaultProps = new Properties();
		try
		{
			fileInpStr = new FileInputStream(configFile);
			defaultProps.load(fileInpStr);
			log.debug("completed");
		}
		catch (FileNotFoundException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		catch (IOException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return defaultProps;
	}
}
